package com.chukun.im.server.application.consumer;

import com.alibaba.fastjson2.JSONObject;
import com.chukun.im.server.common.domain.constants.IMConstants;
import com.chukun.im.server.common.domain.model.IMReceiveInfo;

/**
 * @author chukun
 * @version 1.0.0
 * @description  基础消息消费者
 * @createTime 2024/5/5 16:31
 */
public class BaseMessageConsumer {

    /**
     * 解析数据
     */
    protected IMReceiveInfo getReceiveMessage(String msg){
        JSONObject jsonObject = JSONObject.parseObject(msg);
        String eventStr = jsonObject.getString(IMConstants.MSG_KEY);
        return JSONObject.parseObject(eventStr, IMReceiveInfo.class);
    }

}
